Conversation
* chore(cua-driver): begin exact consent-label lifecycle regression Refs #3705. Reuse the existing public browser_prepare lifecycle test for native red before changing semantic matching. Related localization contributions #3409 and #3140 remain separate. * fix(cua-driver): deduplicate repeated native consent labels Normalize identical AX text fields once so an English Allow/Cancel title repeated in the description remains an exact semantic match. Distinct text still combines, and sheet ownership, action capability, uniqueness, and ambiguity checks remain unchanged. Refs #3705.
f-trycua
left a comment
There was a problem hiding this comment.
The structural fallback is too broad for a consent action. Any sheet in the approved Chromium process with a title-matching heading, two static-text nodes, and three same-row buttons can be classified as the remote-debugging consent dialog even when no remote-debugging semantic anchor is present. remote_debugging_sheet_present then treats that geometry alone as proof and exact_allow_button presses the inferred outer button. That can act on an unrelated three-button Chromium sheet.
The inferred allow polarity is also inconsistent with the Windows implementation and is justified only by synthetic coordinates. Please bind the fallback to a Chromium-specific native consent identity that survives localization, prove the actual Allow/Cancel polarity from live localized macOS AX trees (including RTL), and add negative fixtures for unrelated three-button sheets with the same layout. Run the release-signed existing-profile macOS harness at the final SHA; the current synthetic matcher tests and one manually observed structure are insufficient for an automatic consent press.
Summary
browser_preparefails withbrowser_wrong_target_refused.AXSheet, a heading bound to the sheet title, two explanatory text nodes, and exactly three pressable buttons forming one unambiguous AppKit dialog row. The outer standard action is selected as Allow and the adjacent standard action as Cancel, including mirrored RTL layouts. Ambiguous or incomplete sheets still fail closed.The driver and public browser guidance now distinguish localized setup-page limitations from the native consent dialog, which no longer depends on button text on macOS.
Related work
Refs #2892
RFC: not required; this preserves the existing MCP, permission, and exact-window contracts and changes only the macOS platform matcher.
Compatibility and risk
AXPressbuttons, and a unique separated standard pair. Any geometry or cardinality ambiguity returnsbrowser_wrong_target_refused. Rollback is the single commit in this PR.Validation
cargo test -p platform-macos browser::consent_ui::tests --lib --locked(7 passed)cargo test -p platform-macos --lib --locked(347 passed, 2 ignored environment tests)cargo fmt --all -- --checkcargo clippy -p platform-macos --lib --locked --no-deps -- -D warningswith only pre-existing crate lint categories allowed (passed; the unfiltered command currently fails in unrelated existing modules)git diff --checkContributor and release checks
no-releaselabel is applied. (Not applicable: this is a user-visible Cua Driver fix.)